Machine learning–based inverse design for electrochemically controlled microscopic gradients of O2 and H2O2

Significance In microbiology, extracellular oxygen (O2) and reactive oxygen species (ROS) are spatiotemporally heterogenous, ubiquitously, at macroscopic level. Such spatiotemporal heterogeneities are critical to microorganisms, yet a well-defined method of studying such heterogenous microenvironments is lacking. This work develops a machine learning–based inverse design strategy that builds an electrochemical platform for achieving spatiotemporal control of O2 and ROS microenvironments relevant to microbiology. The inverse design strategy not only demonstrates the power of machine learning to design concentration profiles in electrochemistry but also accelerates the development of custom microenvironments for specific microbial systems and allows researchers to better study how microenvironments affect microorganisms in myriads of environmental, biomedical, and sustainability-related applications.

A fundamental understanding of extracellular microenvironments of O 2 and reactive oxygen species (ROS) such as H 2 O 2 , ubiquitous in microbiology, demands highthroughput methods of mimicking, controlling, and perturbing gradients of O 2 and H 2 O 2 at microscopic scale with high spatiotemporal precision. However, there is a paucity of high-throughput strategies of microenvironment design, and it remains challenging to achieve O 2 and H 2 O 2 heterogeneities with microbiologically desirable spatiotemporal resolutions. Here, we report the inverse design, based on machine learning (ML), of electrochemically generated microscopic O 2 and H 2 O 2 profiles relevant for microbiology. Microwire arrays with suitably designed electrochemical catalysts enable the independent control of O 2 and H 2 O 2 profiles with spatial resolution of ∼10 1 μm and temporal resolution of ∼10°s. Neural networks aided by data augmentation inversely design the experimental conditions needed for targeted O 2 and H 2 O 2 microenvironments while being two orders of magnitude faster than experimental explorations. Interfacing ML-based inverse design with electrochemically controlled concentration heterogeneity creates a viable fast-response platform toward better understanding the extracellular space with desirable spatiotemporal control.
spatiotemporal heterogeneity j microwire array j O 2 and H 2 O 2 microenvironments j neural networks j inverse design Ubiquitous spatiotemporal heterogeneity of natural environments fosters the diverse and fascinating biology that our world embraces, and motivates researchers to mimic natural environments with high spatiotemporal resolution (1)(2)(3)(4)(5). Given their close relevance in biochemical metabolisms, dioxygen (O 2 ) and hydrogen peroxide (H 2 O 2 ) as a surrogate of reactive oxygen species (ROS) are two ubiquitous biologically relevant species in extracellular medium (1,6). Their extracellular spatial and temporal distributions, particularly at the microscopic scale ranging from 1 μm to 100 μm (7)(8)(9)(10)(11), are critical for signal transduction, protein expression, biochemical redox balance, and regulation for cellular metabolism with extensive ecological, environmental, and biomedical implications ( Fig.  1A) (1,3,(8)(9)(10)(11)(12)(13). A programmable creation of the spatiotemporal concentration profiles of O 2 and H 2 O 2 offers the freedom to mimic, control, and perturb the microenvironments of O 2 and H 2 O 2 and hence advance our understanding in microbiology.
Despite recent progress (14)(15)(16)(17)(18), there remain major technical challenges, particularly in the achievable spatiotemporal resolution and high-throughput design of concentration profiles to suit a plethora of scenarios in microbiology. Approaches based on microfluidics and hydrogels have been able to achieve concentration gradients of O 2 and H 2 O 2 through the provision of either O 2 /H 2 O 2 source (14,(19)(20)(21), O 2 /H 2 O 2 scavenging agents (15,22,23), or a combination of both (24) across liquid-impermeable barriers such as agar layers or polymeric thin films (25,26). Yet such approaches, dependent on passive mass transport and diffusion across more than 10 2 μm, are inherently incapable of achieving spatial features of less than 100 μm and temporal resolution smaller than ∼10 1 s, the prerequisites to investigate microbiology at cluster or single-cell levels (10)(11)(12). Moreover, the large variations of extracellular O 2 and H 2 O 2 gradients in different microbial systems demand an inverse design strategy, which, with minimal expenditure, quickly programs a desired concentration profile catering to a specific biological scenario (2)(3)(4)(5). The current lack of inverse design protocol impedes the adoption of controllable extracellular heterogeneity to mimic and investigate microbial systems that are of environmental, biomedical, and sustainability-related significance.
We envision that the integration of electrochemically generated concentration gradients with inverse design based on machine learning (ML) will address the aforementioned challenges (Fig. 1B). Electrochemistry offers a venue for transducing electric signals into microscopic concentration profiles within ∼10 0 μm to ∼10 2 μm away from electrodes' surface, following the specific electrode reaction kinetics and the mass transport governing equations in the liquid phase (27). Proper designs of electrodes'

Significance
In microbiology, extracellular oxygen (O 2 ) and reactive oxygen species (ROS) are spatiotemporally heterogenous, ubiquitously, at macroscopic level. Such spatiotemporal heterogeneities are critical to microorganisms, yet a well-defined method of studying such heterogenous microenvironments is lacking. This work develops a machine learning-based inverse design strategy that builds an electrochemical platform for achieving spatiotemporal control of O 2 and ROS microenvironments relevant to microbiology. The inverse design strategy not only demonstrates the power of machine learning to design concentration profiles in electrochemistry but also accelerates the development of custom microenvironments for specific microbial systems and allows researchers to better study how microenvironments affect microorganisms in myriads of environmental, biomedical, and sustainability-related applications. microscopic spatial arrangement and electrochemical kinetics lead to concentration gradients that are spatiotemporally programmable by time-dependent electric signals of varying voltages (28). Such benefits of electrochemically generated concentration gradients lead us to employ electrochemistry as a tool to spatiotemporally control the concentration profiles in the extracellular medium. In one example, we found that wire arrays electrochemically active toward O 2 reduction create anoxic microenvironment about 20 μm away from the aerobic external bulk environments, modulate the size and extent of O 2 depletion in the anoxic microenvironment by the wire array's morphology and applied electrochemical potential (E appl ), and hence enable O 2 -sensitive rhizobial N 2 fixation in ambient air powered by renewable electricity (29). Moreover, while not reported before as far as we know, electrochemically generated concentration heterogeneity is commensurate with ML-based inverse design (30, 31), thanks to the mathematically well-defined electrochemical processes that can be numerically simulated (32,33). We recently reported neural networks, trained by numerically simulated data, that explore the influence of electrode geometry on electrochemical N 2 fixation and achieve optimized morphologies of wire array electrodes untenable without such an ML-based strategy (34). An inverse design for the electrochemically generated gradients will quickly program desirable microenvironments of O 2 and ROS with high spatiotemporal resolutions, thanks to the well-reported electrochemical transformation related to O 2 and H 2 O 2 with high electrochemical selectivity (35,36).
In this work, we report an inverse design based on neural networks for independent electrochemical creation of O 2 and ROS microscopic gradients that are relevant, and mimic their extracellular heterogeneities in microbial systems. We hypothesize that careful design of electrocatalysis of O 2 reduction reaction (ORR) can either facilitate four-electron ORR on Pt electrocatalyst for a controllable O 2 spatiotemporal profile or promote two-electron ORR on Au electrocatalyst for a programmable generation of H 2 O 2 gradient without significantly perturbing the O 2 one, thanks to their concentration differences in biological mediums (∼10 À1 μM to ∼10 1 μM for H 2 O 2 and ∼10 1 μM to ∼10 2 μM for O 2 ) (2, 7-11). Electrochemically active microwire array electrodes as exemplary model systems (Fig. 1C) are experimentally shown to achieve tunable heterogeneities of O 2 and H 2 O 2 independently, with spatial resolution of ∼10 1 μm and temporal resolution of ∼10°s, and are suitable as a platform for independently perturbing biologically relevant O 2 and H 2 O 2 profiles in microbial systems. We further established and experimentally validated two neural networks that inversely design the wire array electrodes' morphologies toward targeted microenvironments of O 2 and H 2 O 2 , respectively, which is at least one order of magnitude faster than trial-and-error numerical simulation and two orders of magnitude faster than experimental explorations. The demonstrated inverse design of electrochemically generated controlled gradients not only demonstrates a full electrochemical control of concentration profiles in an electrode's proximity but also establishes an approach of spatiotemporally mimicking and perturbing extracellular space guided by artificial intelligence.

Results
Wire Array Electrodes for Electrochemical Generation of O 2 and H 2 O 2 Gradients. We applied a microwire electrode array loaded with selective ORR electrocatalysts to establish customizable O 2 or H 2 O 2 gradients (Fig. 1C). Si-based microwire arrays in a square lattice were constructed through photolithography and reactive ion etching in a five-step fabrication process (see Materials and Methods). After thermal annealing to generate an electrically insulating oxide layer, indium-doped tin oxide (ITO) of 500 nm was deposited via sputtering near conformally onto the wire array, followed by the deposition of about 7 nm of Pt and Au for the generation of O 2 and H 2 O 2 gradients via selective ORR, respectively. Here the deposition of the electrically conducted ITO layer ensures a uniform distribution of the applied electrochemical potential (E appl ). We employed Pt as the selective electrocatalysts of four-electron ORR (35,37,38) in the generation of O 2 gradients, and employed Au for twoelectron ORR (35,39,40) in the generation of H 2 O 2 gradients. The morphologies (Fig. 1 D and E and SI Appendix, Fig. S1) and compositions (SI Appendix, Figs. S2 and S3) of the established wire array were characterized and confirmed by scanning electron microscopy (SEM) equipped with energy dispersive X-ray spectroscopy (EDS), with a vector k = (P, D, L) presenting the wire arrays' periodicity (P), diameter (D), and length (L) in units of micrometers.
The prepared wire array electrodes coated with Pt and Au exhibit desirable electrochemical properties for creating O 2 and H 2 O 2 heterogeneities, respectively. In phosphate-buffered saline (PBS) solution, linear scan voltammograms (20 mV/s) of the deposited Pt electrocatalysts on the wire array (SI Appendix, Fig.  S4) exhibited an onset potential of ORR at around 0.8 V vs. reversible hydrogen electrode (RHE). Linear scan voltammograms of the deposited Au electrocatalysts showed a similar onset potential of ORR at around 0.6 V vs. RHE (SI Appendix, Fig. S5). Experiments of rotating ring-disk electrode for the Au electrocatalysts (SI Appendix, Fig. S6) displayed a selectivity of H 2 O 2 generation from O 2 reduction up to 50% at 0.5 V vs. RHE. Thanks to the reaction-diffusion model in the electrolyte and the electrochemical boundary conditions imposed by the microwire morphology (29,41,42), the Pt-and Au-loaded wire array electrode transduces electric voltages E appl into the concentration gradients of O 2 and H 2 O 2 , respectively, at microscopic length scales.

Electrochemical Generation and Control of O 2 Concentration
Profiles. The Pt-deposited microwire array electrode is capable of spatiotemporally controlling the electrochemically generated O 2 gradient. Thanks to its triplet-triplet quenching with 3 O 2 (43), the phosphorescence emission of Tris(1,10-phenanthroline)ruthenium(II), Ru(phen) 3 2+ , from the intersystem crossing after optical excitation between ∼350 nm and ∼500 nm (44), was utilized to spatiotemporally probe the local concentration of O 2 ([O 2 ]) ( Fig. 2A). The constructed microwire array electrode was housed in a homemade fluidic device (SI Appendix, Fig. S7 Fig. S8). When k = (15,4,50) for the wire array ( Fig. 2 B and C), the three-dimensional I p mapping was recorded in a time sequence when the Pt-coated wire array was initially under an open-circuit condition (t < 15 s), subject to an electrochemical potential (E appl = 0.5 V vs. RHE) from t = 15 and 45 s, and reverted back to the open-circuit condition when t > 45 s (see Materials and Methods). The side views of the threedimensional I p mapping were displayed when E appl was initially absent (t = 0 s), E appl = 0.5 V vs. RHE (t = 16 s), and E appl was absent again at t = 48 s ("t = 0 sec," " t = 16 sec," and "t = 48 sec," respectively, in Fig. 2B). The intensity of I p was noticeably stronger within the wire array when E appl = 0. 5 Fig. 2C), which was quite far away from the wire array, at z = 5 and 50 μm (blue and red, respectively, in Fig. 2C), significant changes of [O 2 ] avg up to a complete anoxic condition were observed, concurrent with the temporal presence of E appl . Such data suggest that the established O 2 gradient can be temporally switched by electrochemical potentials faster than the temporal resolution of the confocal microscopy under the tested conditions (∼2.7 s). The electrochemically established O 2 gradients for wire array k = (30, 3,50) were similarly quantified at E appl = 0.4, 0.5, and 0.6 V vs. RHE as a function of the distance above the bottom of the wire array (z) (black, red, and blue, respectively, in Fig. 2D). The steepness of the generated O 2 gradient increased at lower E appl values under which the electrochemical activities of O 2 consumption on Pt were more pronounced thanks to the increased magnitude of reductive overpotential (SI Appendix, Fig. S4). Such an E appldependent O 2 gradient showed that electrochemical input was capable of spatially controlling and yielding a desirable O 2 gradient for potential biological applications given biologically relevant [O 2 ] values and the spatial resolutions detected here (2-4, 46, 47). The electrochemically driven O 2 gradients were also quantified at E appl = 0.5 V vs. RHE for k = (15, 4, 50), (30, 3,50), and (30, 3, 30) (black, red, and blue, respectively, in Fig.  2E). Noticeably different O 2 gradients were observed, suggesting the capability of the wire array morphology to yield a specific O 2 gradient. Particularly, a strictly O 2 -free local environment in aerated medium was established for k = (15,4,50). Such a customizable O 2 gradient will be of interests for the study of communal interactions among microorganisms of varying degrees of O 2 demands that are prevalent in nature (2).

Electrochemical Generation and Control of H 2 O 2 Concentration
Profiles. We can similarly establish the gradients of H 2 O 2 , a potent ROS relevant to biology (48), with the use of electrochemically active wire array electrodes and H 2 O 2 -yielding Au ORR electrocatalysts. The local concentration of generated H 2 O 2 ([H 2 O 2 ]) was quantified based on the fluorogenic rection that converts nonfluorescent 10-acetyl-3,7-dihydroxyphenoxazine (Amplex Red) to fluorophore resorufin (λ ex = 550 nm; λ em = ∼590 to ∼650 nm) catalyzed by horseradish peroxidase (HRP) (49). Under the similar setup mentioned above (SI Appendix, Fig. S7), the emission intensities of resorufin (I f ), and hence the local [H 2 O 2 ] value, were determined for an Au-coated wire array electrode under confocal microscopy, assisted by the corresponding calibration curves (SI Appendix, Figs. S9-S12; see Materials and Methods). When k = (15, 4, 50) for the wire array ( Fig. 3 B and C), the three-dimensional I f mapping was similarly recorded in a time sequence when the Au-coated wire array was initially under an open-circuit condition (t < 20 s), subject to an electrochemical potential (E appl = 0.5 V vs. RHE) from t = 20 and 50 s, and reverted back to the open-circuit condition when t > 50 s (see Materials and Methods). The side views of the three-dimensional I f mapping were also displayed when E appl was initially absent (t = 0 s), E appl = 0.5 V vs. RHE (t = 22 s), and E appl was absent again at t = 52 s ("t = 0 sec," " t = 22 sec," and "t = 52 sec," respectively, in Fig. 3B). While the absence of E appl correlates with the absence of fluorescent emission from resorufin ("t = 0 sec" and "t = 52 sec" in  We seek to establish computational models that can inversely predict the values of E appl and k = (P, D, L) of the Pt-and Au-loaded wire array electrodes for targeted corresponding O 2 and H 2 O 2 gradients ([O 2 ](z) and [H 2 O 2 ](z)), respectively. Such an inverse design strategy for O 2 and H 2 O 2 microenvironments is proposed to be much more time efficient in comparison with the classical trial-anderror approach (Fig. 4A), and will find plentiful applications given the high variabilities of biological applications in both spatial and temporal domains (2,3,8). Critical inside such computational models are neural networks, trained with sufficient amounts of   (32) to augment the available data (Fig. 4B). FEM-based electrochemical simulations have been widely used in the understanding and design of electrochemical applications, with satisfactory accuracies (32,33,(53)(54)(55). We established electrochemical microkinetic models that include the mass transport of redox species and the electrochemical reduction of O 2 Fig. S13 B and C) ](z) based on inputs of fE appl , k = (P, D, L)g, which were trained based on 10,000 data points augmented from the FEM-based simulations (see Materials and Methods). As the model-training process proceeds with an increasing number of epochs, monotonic decreases of the average MSE (AMSE) between the training and predicted data points for the datasets of both validation and training (red and black dots, respectively) were observed in Fig. 4 C and D for the O 2 and H 2 O 2 gradients near Pt-and Au-loaded wire array electrodes, respectively. The fact that the values of AMSEs against the validation datasets were similar to the ones from the training datasets in Fig. 4 C and D indicates that there was no overfitting in the ML process (56). In the end, near-unity coefficients of determination (R 2 ! 1) were observed for both MLPNNs (MLPNN 1 that predicts O 2 gradient and MLPNN 2 that predicts H 2 O 2 gradient) ( Fig. 4 E and F, respectively)    good predictabilities for the establishment of desirable O 2 and H 2 O 2 microenvironments. In microbiology and microbial ecology, it is desirable to establish well-defined microenvironments whose sizes are ∼20 μm to ∼100 μm in order to mimic natural heterogenous distribution of biologically relevant extracellular species such as nutrients and other microbial resources (57). Within such length scales, establishing microoxic niche (i.e., [O 2 ] ≈ 100 μM) in the midst of an oxic external environment (Fig. 5A), prevalent in aquatic, terrestrial, and host-associated environments, is challenging yet desirable for understanding the physiology and ecology of microaerophiles and advancing our understanding of microbiomes (2); extracellular H 2 O 2 whose concentration can achieve 15 μM (58) (Fig. 5B) is also of particular interest in order to study microbial sensing, communal signaling, metabolic regulation, and genetic expression toward ROS (48,59). In such biological contexts, we aim to inversely design one O 2 gradient (Δ[O 2 ] ≈ 100 μM and Δz ≈ 40 μm) and one H 2 O 2 gradient (Δ[H 2 O 2 ] ≈ 15 μM and Δz ≈ 100 μm) based on our developed MLPNNs (Fig. 5 A and B). We utilized the established MLPNNs that predict [O 2 ](z) and [H 2 O 2 ](z) under different inputs of fE appl , k = (P, D, L)g, and we scored the similarity percentages between the MLPNN-predicted O 2 /H 2 O 2 gradients and the desirable ones. Fig. 5 C and D exemplarily display the sliced mappings of similarity scores for the aforementioned O 2 and H 2 O 2 gradients on Pt-and Au-loaded wire arrays, respectively, as a function of k = (P, D, L) at E appl = 0.5 V vs. RHE. Such multidimensional mapping, composed of 10,000 data points each in Fig. 5 C and D, showcases the parameter spaces that are predicted to yield the desirable O 2 and H 2 O 2 microenvironments within a certain relative uncertainty threshold (red region) (see Materials and Methods). It is intriguing to note that there existed multiple different wire array morphologies to yield the same desirable O 2 and H 2 O 2 gradients, which may not be straightforward, intuitively. We estimated that the determination of O 2 /H 2 O 2 gradients for one parameter coordinate in the space of fE appl , k = (P, D, L)g will take ∼4 s for the MLPNN-based method, ∼90 s from FEM-based simulations, and ∼20 mins for the confocal characterization alone at one specific E appl for a single wire array morphology, notwithstanding any time spent in any preceding protocols (see Materials and Methods). Therefore, a comprehensive exploration of the parameter space fE appl , k = (P, D, L)g with more than 10 4 trials as shown above is only possible with the use of MLPNN-based inverse design, because only the MLPNN is capable of screening 10,000 parameter combinations within a reasonable amount of time in practice (∼12 h) in comparison to the ones based on FEM (∼250 h, i.e., ∼10 d) and experimental characterization (at least 3,000 work-hours without considering any practical concerns) (Fig. 4A). We also conducted a spot check for the predicted O 2 and H 2 O 2 microenvironments by experimental validations. A Pt-based wire array electrode with k = (46, 6, 20) was picked from Fig. 5C as a desirable geometry, experimentally prepared (Fig. 1E), and experimentally tested for the established O 2 gradient at E appl = 0.5 V vs. RHE. Satisfactory consistency with MSE = 5.63 × 10 À4 mM 2 was achieved between the experimental and targeted values of [O 2 ](z) (dots and line, respectively, in Fig. 5E). Similarly, an Au-based wire array electrode with k = (17, 3, 30) was picked from Fig. 5D, experimentally prepared (Fig. 1E), and experimentally tested for the H 2 O 2 gradient at E appl = 0.45 V vs. RHE. We also observed satisfactory consistency with MSE = 7.22 × 10 À6 mM 2 between the experimental and targeted values of [H 2 O 2 ](z) (dots and line, respectively, in Fig. 5F). While we were unable to experimentally exhaust all of the predicted parameter space for the desirable microenvironments of O 2 and H 2 O 2 , our experimental validations offer convincing evidence for the validity of the developed MLPNNbased inverse design for future microbiology-related research.

Discussion
In summary, we presented a ML-based inverse design strategy for O 2 and H 2 O 2 concentration profiles with the use of electrochemical catalysis of ORR. We demonstrated a proof-of-concept closed-loop protocol for inversely designing O 2 and H 2 O 2 gradients with properly designed microwire electrodes in PBS solution, the go-to culturing medium in microbiology. By achieving concentration differences and spatial resolutions that are relevant to microbial microenvironments, the demonstrated O 2 and H 2 O 2 gradients are applicable for studies in microbiology. While the reported research focuses on one specific form of electrochemical boundary conditions, namely, microwire array, the reported inverse design procedures are generally applicable for any electrochemical systems that can be parameterized and analyzed by neural networks. As mass transport and concentration profiles in an electrode's proximity are important components in electrochemistry, this work demonstrates the power of ML-based inverse design in electrochemistry. Moreover, our results will lead to a general platform that inversely designs suitable electrochemical systems for any targeted environments of O 2 and H 2 O 2 in microbiology. Future research will focus on the platform's application of in vivo microbial communities and fundamental insights that can be fetched thanks to our system's unique capabilities. Moreover, since electrochemistry is capable of modulating any redox active species such as extracellular Fe(II)/(III) species (60), as well as other extracellular metabolites sensitive to oxidative stress, such as pyocyanin (61)(62)(63), our inverse design approach based on electrochemistry is capable of controlling the other microenvironments beyond O 2 and ROS and is generally applicable in the study of ubiquitous microenvironments in extracellular medium.
Experimental Establishment of Testing Platform. Modified from a previously published protocol (29), the experimental testing platform as shown in SI Appendix, Fig. S7 consists of a fluidic cell with a three-electrode system, in order to electrochemically generate desirable gradients of O 2 and H 2 O 2 . As the working electrode in the setup, microwire array electrodes were fabricated similarly as previously described (29). The microwire arrays were fabricated by photolithography with the use of the deep reactive-ion etching process (DRIE). After treatment in hexamethyldisilazane vapor for 10 min, precleaned Si wafers were coated with photoresist (MicroChemicals, AZ5214E; 3000 rpm spin coating) by soft baking (100°C for 75 s), exposed in the hard contact mode by a contact aligner (Carl Suss MA6), hard baked (120°C, 5 min), and developed to generate the periodic patterns for the array (mixture of MicroChemicals AZ400K water, 1:4 volume ratio). After creation by DRIE (Unaxis Versaline FDSE III), microwire arrays of desirable lengths were annealed under ambient air at 1,050°C for 9.5 h to yield the insulating oxide layer, coated by 500-nm ITO through reactive sputtering (Denton Discovery 550 sputtering System), and finally deposited with a 7-nm layer of Pt or Au by an Anatech Hummer 6.2 sputtering system. The structure of the wire array was examined by SEM (ZEISS Supra 40VP SEM), and the element distribution was examined by SEM (JEOL JSM-6700F) equipped with EDS (Ametek). Patterned ITO-coated glass slides were used as the counter electrodes in the established testing platform, after the selective removal of ITO by 6 M HCl in undesirable areas on the glass slides. Ag paint as the pseudoreference electrode was applied on select areas of the ITO-coated slides so as to cover a 5 mm × 5 mm square with a layer of silver, serving as the reference electrode, while Pt was deposited on other ITO-coated areas for the creation of a counter electrode in the setup. An optically transparent fluidic cell of 250-μm height was constructed by assembling the microwire array electrodes with the prefabricated ITO glass slides, while a Gamry Interface 1010B potentiostat was used to enforce the electrochemical driving force. The setup was mounted on an inverted laser confocal microscope (Leica SP8 SMD) with sufficient working distance (680 μm), and a syringe pump was used to maintain a fixed liquid flow rate. As we particularly ensure the accuracy of applied electrochemical potentials, cyclic voltammetry in a standard ZoBell's solution (3.3 mM K 3 Fe(CN) 6 , 3.3 mM K 4 Fe(CN) 6 , and 0.1 M KCl, 0.43 V vs. standard hydrogen electrode) was employed to calibrate the electrochemical potential of an Ag-based pseudoreference electrode as shown in SI Appendix, Fig. S14 (64, 65). The Ag-based pseudoreference electrode was calibrated as 0.75 V vs. RHE in PBS solution at pH = 7.4.

Electrochemical Characterization of the Deposited Electrocatalysts.
While the deposited Pt electrocatalysts have been characterized in our prior report (29), experiments were conducted to analyze the electrocatalytic activities of ORR for the coated Au electrocatalysts. An experiment of a rotating ring-disk electrode (Pine Research, Inc., AFE6R1PT) was conducted in PBS solution using a setup with a Pt-wire counter electrode, Ag/AgCl (1M KCl) reference electrode and a modulated speed rotator (Pine Research, Inc., AFMSRCE). While a Pt ring electrode was kept at 1.9 V vs. RHE, linear scan voltammograms (20 mV/s) were recorded between 0.1 and 1.1 V vs. RHE with different rotating speeds (100, 225, 400, 625 , 900, 1,225, 1,600 pm, and 2,025 rpm) in electrolytes saturated with O 2 and N 2 , respectively. The measurements in N 2 -saturated solution were used as the signal background.
Quantification and Calibration of O 2 Concentration Profiles. Aerated PBS solution consisting of 150 μM Ru(phen) 3 Cl 2 solution was prepared in the dark and fed into the assembled testing platform at a flow rate of 0.8 mL/min. The phosphorescence intensity mapping under confocal microscopy was measured in a 1-min time sequence. During the 1-min confocal microscopy measurement, programmed 30-s electrolysis was performed with a particular potential on the working electrode from t = 15 s to t = 45 s. The excitation wavelength was set as 470 nm, and we gathered emission intensity from 600 nm to 640 nm as phosphorescence emission intensity I p . We defined the phosphorescence emission intensity with no potential applied as I 0 . Normalized phosphorescence emission intensity I pn was defined as I pn ¼ I p =I 0 . The phosphorescence emission intensity distribution was further translated into the concentration profiles, based on the linear relationship between O 2 concentration and the inverse of I pn (noted as I pn

À1
) that was experimentally determined. Ru(phen) 3 Cl 2 -containing PBS solutions of different O 2 concentrations, ranging from [O 2 ] = 25 μM to 375 μM, were prepared by bubbling a N 2 /O 2 mixture of tunable ratio through the solution, and were pumped into the assembled fluidic device (0.8 mL/min) for calibration.
Quantification and Calibration of H 2 O 2 Concentration Profiles. Aerated PBS solution consisting of 0.2 U/mL HRP and 120 μM Amplex Red (1× working solution) was prepared in the dark and fed into the assembled testing platform at a flow rate of 0.8 mL/min. The fluorescent intensity mapping under confocal microscopy was conducted in a 1-min time sequence. During the 1-min confocal microscopy measurement, programmed 30-s electrolysis with a particular potential on the working electrode from t = 20 s to t = 50 s. The excitation wavelength was set as 550 nm, and we gathered emission intensity from 590 nm to 650 nm as fluorescence emission intensity I f . The fluorescence emission intensity distribution was further translated into the concentration profiles, based on the corresponding calibration curves. In the experiments of calibrating H 2 O 2 concentrations, darkly prepared PBS solution consisting of 0.4 U/mL HRP and 240 μM Amplex Red was combined with PBS solutions of different H 2 O 2 concentrations, ranging from 5 μM to 60 μM, and was pumped into the assembled devices for the measurement of confocal microscopy. We found that the H 2 O 2 -induced fluorescence intensity I f is also dependent on the specific morphologies of the wire array (k) and the distance away from the bottom of the wire array (z) (SI Appendix, Fig. S15), owing to the scattering and, possibly, optical absorption of the wire array electrodes (66)(67)(68). Therefore, individual calibration curves were determined for every z location in wire arrays with all possible k values (SI Appendix, Figs. S9-S12). Specific I f correction was made to compensate the difference between the calibration experiment and gradient optical detection due to practical restrictions (SI Appendix, Supplementary Text and Fig. S16).

FEM-Based Numerical Simulations for O 2 Gradient and H 2 O 2
Gradients. FEM simulation of both O 2 gradient and H 2 O 2 gradient was achieved in "electroanalysis" module in COMSOL Multiphysics (Version 5.3). Geometry description. The shape of wire was represented by a column with diameter D and length L. We located each wire in the center of a cuboid of P × P × 200 μm, and the difference between the cuboid and column was geometrically defined for the electrolyte. For each point in the electrolyte, if its distance from the top of the wire not smaller than the diffusion distance, d D , we considered that it belonged to the bulk electrolyte in which [O 2 ] = 246 μM, independent of time. The boundary surface was defined as the area of which the distance to the top of the wire is d D . On the boundary surface, the [O 2 ] was the same as that in the bulk. A periodic boundary condition was applied to describe the wire array. The value of d D was set as 20 μm for O 2 gradient simulation on Pt-loaded wire array electrodes (29). For O 2 gradient and H 2 O 2 gradient simulation on Au-loaded wire array electrodes, d D was measured as 50 μm (SI Appendix, Fig. S17). Transport properties. The diffusion of oxygen and hydrogen peroxide was simulated based on the following Eqs. 1 and 2. D O 2 and D H 2 O 2 are the diffusion coefficients of oxygen and hydrogen peroxide in aqueous solution, which were 2.2 × 10 À9 m 2 /s and 1.5 × 10 À9 m 2 /s respectively.
Electroanalysis. The potential window of E appl is from 0.6 V vs. RHE to 0.2 V vs. RHE.
On the surface of Pt-loaded wire array electrodes, 4e-ORR took place within the potential window.
On the electrode surface of Au-loaded wire array electrodes, two-electron and four-electron ORR reactions (2e-ORR and 4e-ORR, respectively) took place at the same time as potential-dependent selectivity.
On the surface of Pt-loaded wire array electrodes, the supply-consumption equilibrium was simulated as Eqs. 3 and 4 in the formalism of concentrationdependent Tafel kinetics (27), Here i 4e denotes the current density of 4e-ORR, i 0,4e,Pt denotes the exchange current density of 4e-ORR, i loc denotes the local current density of four-electron reduction of O 2 on the electrode surface, J O 2 denotes the local flux of O 2 consumption from electrolyte, and η Pt is the overpotential that is defined as the difference between E appl and the standard redox potential of (1.23 V vs. RHE). The α c equals 0.5 as the transfer coefficient, F denotes the Faraday constant, R is the gas constant, T is the temperature, and n 4e is the electron transfer number before the rate-determining step of 4e-ORR, of which the value is one (SI Appendix, Fig. S4). The local oxygen concentration is denoted as [O 2 ]. C O 2 is the oxygen concentration in air-saturated water at T. The above equation follows the textbook equations that account for the mass transport and chemical stoichiometry at electrode interfaces (27). On Pt-loaded wire array electrodes, i 0,4e,Pt is found to be 3.0 × 10 À6 A/m 2 (SI Appendix, Fig. S4).
On the electrode surface of Au-loaded wire array electrodes, the supplyconsumption equilibrium was simulated as Eqs. 5-7.
While most of the definitions of variables in the case of Au-loaded wire array electrodes with Eqs. 5-7 are the same as the Pt-loaded case in Eqs. 3 and 4, we noted that i loc instead stands for the local current density of both two-electron and four-electron reduction of O 2 on the electrode surface, i 2e , the current density of 2e-ORR, and n 2e is electron transfer number before the rate-determining step of 2e-ORR, of which the value is 0.7 (SI Appendix, Fig. S5). On Au-loaded wire array electrodes, the catalysis selectivity of Au toward 4e-ORR and 2e-ORR is dictated by the exchange current densities i 0,4e,Au and i 0,2e,Au , respectively. The i 0,4e,Au is 2.0 × 10 À8 A/m 2 , and i 0,2e,Au is 8.0 × 10 À7 A/m 2 , based on literature and measurement (SI Appendix, Fig. S5) (69,70). Based on a comparison with experimental gradients, the AMSE of O 2 gradient simulation and H 2 O 2 gradient simulation on Pt-loaded wire array electrodes and Au-loaded wire array electrodes is 9.81 × 10 À4 mM 2 and 4.84 × 10 À6 mM 2 , respectively. The range of E appl was set within the ORR potential windows, from 0.6 V vs. RHE to 0.2 V vs. RHE. Besides, a three-dimensional block was defined in the space of (P, D, L) as the range of morphology, from P = 1 μm to 100 μm, L = 1 μm to 150 μm, and D = 0.2 μm to 10 μm. By using Simulink in Matlab, we were able to generate random k value within the morphology space and calculate the corresponding gradient curves. To fulfill the ML functions, gradient profiles under 10,000 experimental conditions were included in the dataset for each developed multiple-layer perceptron neural network, respectively.
Model Selection and Training. The implementation of all ML code was done on a MacBook Pro with a 1.4 GHz quad-core Intel Core i5 processor and 8GB of RAM, with code specifically deployed using the JupyterLab Notebook, a Pythonbased programming platform widely used in data science and ML (34). In this paper, we selected MLPNNs as the ML model for inverse design. We use FEMsimulated gradients to develop the MLPNNs. Gradient data were imported from FEM results in the form of .csv files and combined into a library of data. Prior to the model development, a random 20% of the data were split from the whole dataset for later model validation. The rest of the data were split into training data and validation data, of which the percentages were 65% and 15%, respectively. Multiple cycles of model training, each cycle termed as one epoch, were conducted in order to develop the targeted MLPNNs. In each epoch, MLPNNs will be trained from the training data, followed by a validation process in the validation dataset used to provide estimates of final model accuracy after each round of training. The total ML process will include 10 epochs of forward and backward propagations. The accuracies of the developed MLPNNs model as a function of epoch numbers are plotted in Fig. 4 C and D.
As described in the section above, the training dataset was a collection of concentration gradients under different E appl and k values. We used AMSE and SD, defined in more detail below, from Eqs. 8-11 to quantify the ability of ML models to correctly reveal the connection between gradient curves and the two impacting factors, E appl and k. In model selection, we selected multiple-layer perceptron neural networks for gradient prediction due to the low AMSE and SD value gradient prediction (SI Appendix, Fig. S18).
For both O 2 and H 2 O 2 gradients, the predicted curve included 20 local concentration datum along the wire array from Z = 5 μm to 100 μm every 5 μm. Z is defined as the distance from the bottom of the wire array. In O 2 gradient prediction, MSE and SD are defined as the following equations: In Eqs. 8 and 9, ½O 2 NNs stands for the predicted oxygen concentration from MLPNNs predicting the O 2 gradient on the Pt-loaded wire array. ½O 2 real is the oxygen concentration in the simulation dataset. MSE O is defined based on the average square of concentration difference over the whole gradient profile. AMSE o is the average MSE over the whole dataset. We calculated the SD over data under a wide range of experimental conditions to evaluate the overall precision of predictions from MLPNNs predicting the O 2 gradient on the Pt-loaded wire array. MSE and SD in the H 2 O 2 gradient were defined in a similar pattern. In Eqs. 10 and 11, ½H 2 O 2 NNs stands for the predicted hydrogen peroxide concentration from MLPNNs predicting the H 2 O 2 gradient on the Au-loaded wire array. ½H 2 O 2 real is the hydrogen peroxide concentration in the simulation dataset. MSE H is defined based on the average square of concentration difference over the whole gradient profile. AMSE H is the average MSE over the whole dataset. In the sliced mapping of the H 2 O 2 similarity score, the similarity score at L = 5 μm was the average of from L = 0 μm to 10 μm. The similarity score at L = 20 μm was the average of from L = 10 μm to 30 μm. The similarity score at L = 40 μm was the average of from L = 30 μm to 50 μm. The similarity score at L = 60 μm was the average of from L = 50 μm to 70 μm. The similarity score at L = 80 μm was the average of from L = 70 μm to 90 μm. The similarity score at L = 95 μm was the average of from L = 90 μm to 100 μm.
Data Availability. All study data, except the code for the neural networks, are included in the article and/or SI Appendix. The code for the neural networks is available on B.B.H.'s GitHub account http://github.com/bbhoar/O2_H2O2_ ML_PNAS.